package com.jishuo.nontax.bean.vo;

import com.jishuo.base.util.StringObject;
import com.jishuo.base.util.StringUtil;
import com.jishuo.nontax.bean.bank.PaySpecial;
import com.jishuo.nontax.bean.message.SetBankPaySpecialBackOut;
import com.jishuo.nontax.bean.message.SetPaySpecial;
import com.jishuo.nontax.bean.message.SetPaySpecialNew;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @auther dinggaofei
 * @Date 2023/2/2 9:34
 */
@SuppressWarnings("serial")
@Data
public class PaySpecialVO {

    /**
     * 流水号
     */
    private Long payid;

    /**
     * 票据号ZH20090317001
     */
    private String billnum;

    /**
     * 区划流水号
     */
    private Long cantonid;

    /**
     * 缴款开户银行流水号
     */
    private Long payerbankid;

    /**
     * 预算级次 0:中央
     * 1:省级
     * 2:市级
     * 3:县级
     */
    private Integer payeelevel;

    /**
     * 项目流水号
     */
    private Long itemid1;

    /**
     * 项目1金额
     */
    private BigDecimal itemmoney1;

    /**
     * 是否银行确认划款
     */
    private int isbankaffirm;

    /**
     * 银行交易流水号
     */
    private String bankaffirm;

    /**
     * 银行划款时间
     */
    private String paybankdt;

    /**
     * 银行网点 名称
     */
    private String bankstation;

    /**
     * 单据状态
     */
    private int billstate;

    /**
     * 收款单位名称
     */
    private String payeeunitname;

    /**
     * 收款单位的银行名称
     */
    private String payeebankname;

    /**
     * 收款单位的银行帐号
     */
    private String payeebankaccount;

    /**
     *
     */
    private Integer issend;

    /**
     *
     */
    private Long messageid;

    /**
     * 打印时间
     */
    private String writedate;

    /**
     * 发送时间
     */
    private String sendtime;

    /**
     * 银行核心交易流水号
     */
    private String hxbankaffirm;

    /**
     * 项目编码
     */
    private String itemcode;

    /**
     * 项目名称
     */
    private String itemname;
    /**
     * 区划编码
     */
    private String cantoncode;
    /**
     * 区划名称
     */
    private String cantonname;
    /**
     * 帐号
     */
    private String accountcode;
    /**
     * 帐户名称
     */
    private String accountname;
    /**
     * 银行名称
     */
    private String bankname;
    //付款户名
    private String payerbankname;
    //付款銀行账号
    private String payeraccountname;
    //付款银行开户行
    private String payeraccountcode;
    /**
     * 页面列表
     */
    private String payeeaccountcode;

    private  String  billid;


    public PaySpecialVO() {
    }


    //从SetPayspecial获取数据
    public PaySpecialVO(SetPaySpecial bean) {

        this.cantonid = Long.valueOf(bean.getCantonid());
        this.itemid1 = Long.valueOf(bean.getItemid());
        this.payerbankid = Long.valueOf(getPayerbankid());
        this.payeelevel = Integer.valueOf(bean.getPayeelevel());
        this.payeeunitname = bean.getPayeeunitname();
        this.payeebankname = bean.getPayeebankname();
        this.payeebankaccount = bean.getPayeeaccount();
        this.itemmoney1 = new BigDecimal(bean.getMoney());
        this.billnum = bean.getBillnum();

    }

    //从SetPayspecial获取数据
    public PaySpecialVO(SetPaySpecialNew bean) {
        this.cantonid = (StringUtil.isEmpty(bean.getCantonid())) ? null : Long.valueOf(bean.getCantonid());
        this.itemid1 = (StringUtil.isEmpty(bean.getItemid())) ? null : Long.valueOf(bean.getItemid());
        this.payerbankid = Long.valueOf(bean.getPayerbankid());
        this.payeelevel = (StringUtil.isEmpty(bean.getPayeelevel())) ? null : Integer.valueOf(bean.getPayeelevel());
        this.payeeunitname = bean.getPayeeunitname();
        this.payeebankname = bean.getPayeebankname();
        this.payeebankaccount = bean.getPayeeaccount();
        this.itemmoney1 = new BigDecimal(bean.getMoney());
        this.billnum = bean.getBillnum();
        this.itemcode = bean.getItemcode();
        this.itemname = bean.getItemname();

    }


    //返回PaySpecial划解专户对象
    public PaySpecial getPaySpecial() {
        PaySpecial bean = new PaySpecial();
        bean.setBillstate(StringObject.objectString(this.billstate));
        bean.setPayid(StringObject.objectString(this.payid));
        bean.setBillnum(this.billnum);
        bean.setCantonid(StringObject.objectString(this.cantonid));
        bean.setCantoncode(this.cantoncode);
        bean.setCantonname(this.cantonname);
        bean.setItemid(StringObject.objectString(this.itemid1));
        bean.setItemcode(this.itemcode);
        bean.setItemname(this.itemname);
        bean.setPayerbankid(StringObject.objectString(this.payerbankid));
        bean.setAccountcode(this.accountcode);
        bean.setAccountname(this.accountname);
        bean.setBankname(this.bankname);
        bean.setPayeelevel(StringObject.objectString(this.payeelevel));
        bean.setPayeeunitname(this.payeeunitname);
        bean.setPayeebankname(this.payeebankname);
        bean.setPayeeaccount(this.payeebankaccount);
        bean.setMoney(StringObject.objectString(this.itemmoney1));
        return bean;
    }

    public SetBankPaySpecialBackOut getSetBankPaySpecialBackOut(){
        SetBankPaySpecialBackOut out = new SetBankPaySpecialBackOut();
        out.setPayid(StringObject.objectString(this.payid));
        out.setBillnum(this.billnum);
        out.setCantonid(StringObject.objectString(this.cantonid));
        out.setPayerbankid(StringObject.objectString(this.payerbankid));
        out.setPayeelevel(StringObject.objectString(this.payeelevel));
        out.setPayeeunitname(this.payeeunitname);
        out.setPayeebankname(this.payeebankname);
        out.setPayeeaccount(this.payeeaccountcode);
        out.setItemid(StringObject.objectString(this.itemid1));
        out.setMoney(StringObject.objectString(this.itemmoney1));
        out.setBankaffirm(this.bankaffirm);
        out.setPaybankdt(this.paybankdt);
        out.setBankstation(this.bankstation);
        return  out;

    }
}
